import React from "react";


// 配置路由表

// 一级路由
const Login = React.lazy(() => import('../view/Login'))   //登录
const Register = React.lazy(() => import('../view/Register'))   //注册
const Home = React.lazy(() => import('../view/Home'))//主页
const AddHouse = React.lazy(() => import('../view/AddHouse'))// 添加房源


// 二级路由
const House = React.lazy(() => import('../view/House'))// 房源管理
const Audit = React.lazy(() => import('../view/Audit'))// 审核管理
const Broker = React.lazy(() => import('../view/Broker'))// 经纪人管理
const Group = React.lazy(() => import('../view/Group'))// 团购管理
const InformAtion = React.lazy(() => import('../view/Information'))// 资讯管理
const Management = React.lazy(() => import('../view/Management'))// 直播管理
const Order = React.lazy(() => import('../view/Order'))// 订单管理

export const children = [
    {
        path: '/',
        element: <House />,
        title: '房源管理',
    },  {
        path: '/management',
        element: <Management />,
        title: '直播管理',
    }, {
        path: '/group',
        element: <Group />,
        title: '团购管理',
    }, {
        path: '/audit',
        element: <Audit />,
        title: '审核管理',
    }, {
        path: '/order',
        element: <Order />,
        title: '订单管理',
    }, {
        path: '/informAtion',
        element: <InformAtion />,
        title: '资讯管理',
    }, {
        path: '/broker',
        element: <Broker />,
        title: '经纪人管理',
    }
]


// 一级路由
const routes: any = [
    {
        path: '/',
        element: <Home />,
        title: '主页',
        children: children
    }, {
        path: '/login',
        element: <Login />,
        title: '登录',
    }, {
        path: '/register',
        element: <Register />,
        title: '登录',
    },{
        path: '/AddHouse',
        element: <AddHouse />,
        title: '添加房源',
    },
]

export default routes
